﻿@namespace Blazorise.Docs.Docs.Examples

<Button Color="Color.Primary" Clicked="@ShowToast">Show toast message!</Button>

@code {
    [Inject] IToastService ToastService { get; set; }

    Task ShowToast()
    {
        return ToastService.Info( "This is a simple toast message!", "Hello", BuildToastInstanceOptions );
    }

    private void BuildToastInstanceOptions( ToastInstanceOptions toastInstanceOptions )
    {
        toastInstanceOptions.Animated = true;
        toastInstanceOptions.AnimationDuration = 300;
        toastInstanceOptions.Autohide = true;
        toastInstanceOptions.AutohideDelay = 3000;
    }
}